@model EIMS.Models.ViewModels.SupplierTransactionViewModel

@{
    ViewData["Title"] = "编辑供应商交易记录";
}

<div class="container-fluid">
    <h1 class="mt-4">编辑供应商交易记录</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">首页</a></li>
        <li class="breadcrumb-item"><a asp-controller="Supplier" asp-action="Index">供应商管理</a></li>
        <li class="breadcrumb-item"><a asp-controller="Supplier" asp-action="Details" asp-route-id="@Model.SupplierId">供应商详情</a></li>
        <li class="breadcrumb-item active">编辑交易记录</li>
    </ol>

    <div class="card mb-4">
        <div class="card-header">
            <i class="fas fa-money-bill-alt me-1"></i>
            交易记录信息
        </div>
        <div class="card-body">
            <form asp-action="EditTransaction">
                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                <input type="hidden" asp-for="Id" />
                <input type="hidden" asp-for="SupplierId" />

                <div class="row mb-3">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label asp-for="SupplierName" class="control-label"></label>
                            <input asp-for="SupplierName" class="form-control" readonly />
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="TransactionNumber" class="control-label"></label>
                            <input asp-for="TransactionNumber" class="form-control" />
                            <span asp-validation-for="TransactionNumber" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="TransactionDate" class="control-label"></label>
                            <input asp-for="TransactionDate" class="form-control" type="date" />
                            <span asp-validation-for="TransactionDate" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Amount" class="control-label"></label>
                            <input asp-for="Amount" class="form-control" />
                            <span asp-validation-for="Amount" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="TransactionType" class="control-label"></label>
                            <select asp-for="TransactionType" class="form-select" asp-items="ViewBag.TransactionTypes"></select>
                            <span asp-validation-for="TransactionType" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="PaymentMethod" class="control-label"></label>
                            <select asp-for="PaymentMethod" class="form-select" asp-items="ViewBag.PaymentMethods"></select>
                            <span asp-validation-for="PaymentMethod" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="PaymentStatus" class="control-label"></label>
                            <select asp-for="PaymentStatus" class="form-select" asp-items="ViewBag.PaymentStatuses"></select>
                            <span asp-validation-for="PaymentStatus" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label asp-for="Description" class="control-label"></label>
                            <textarea asp-for="Description" class="form-control" rows="3"></textarea>
                            <span asp-validation-for="Description" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <button type="submit" class="btn btn-primary">
                        <i class="fas fa-save"></i> 保存
                    </button>
                    <a asp-action="Details" asp-route-id="@Model.SupplierId" class="btn btn-secondary">
                        <i class="fas fa-arrow-left"></i> 返回供应商详情
                    </a>
                </div>
            </form>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} 